package com.xsp.service.Impl;

import com.xsp.dao.BookInfoMapper;
import com.xsp.entity.BookInfo;
import com.xsp.service.BookInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author xsp
 * @date 2024/1/17
 * @desc
 */
//@Service("bookInfoServiceImpl3")
public class BookInfoServiceImpl3 implements BookInfoService {
    // 字段注入：默认根据字段名查找容器中同名的bean，若没找到，则会根据类型匹配查找
    // 若没找到，才根据类型找
    // 若根据类型没找到，则需要根据自定义配置的bean的名称查找--name
    @Resource(name="bookInfoMapperImpl2")
    private BookInfoMapper bookInfoMapper;

    @Override
    public void addBook(BookInfo bookInfo) {
        bookInfoMapper.insert(bookInfo);
        System.out.println("添加成功");
    }
}
